functionNvic_prioritygroupconfig (nvic_prioritygroup_2);//set interrupt Priority group to group 2:2-bit preemption priority, 2-bit response priorityUart_init (115200);//serial port initialized to 115200Led_init ();//initializing the hardware interface to the LED connection while(Dht11_init ())//DHT11 Initialization{printf ("DHT11 error\r\n"); Delay_ms ( the); }
If you want to use the Arduino Development Board drive DHT11 to obtain temperature and humidity, it is recommended to use a third-party library, which can speed up the development of the program, and is not prone to error, the following code I have been transferred to the third-party library. For detailed installation methods, please refer to the Geek Pioneer's blog: The http://www.cnblogs.com/jikexianfeng/
http://blog.csdn.net/qwert1213131/article/details/35828873
This article belongs to the individual understanding, the ability is limited, the mistake is unavoidable, also looks correct.
"Little Fish has a little electricity."
"Espruino Chinese Community"
In section 10th, a DS18B20 temperature sensor is introduced, which introduces a sensor DHT11 that detects t
The previous period of development of telemedicine system (Dr.cloud) has used over temperature and humidity sensor, but at that time considering the difficulty of integration, selected a RS485 interface sensor, the sensor realizes the Modbus RTU slave function, as long as the client program to achieve Modbus RTU The cl
] |=1;//writes data 1 toJ + +;}}/*Start processing data 1. Because a complete data output is 40 bits, J should be greater than 402.dht11_val[4] for checksum, here to determine if the checksum is correct 3. Print only dht11_val[0], dht11_val[2] because dht11_val[ 1], dht11_val[3] is a fractional part, according to the data sheet decimal is always zero*/if(J >= +) (dht11_val[4] = = ((dht11_val[0] + dht11_val[1] + dht11_val[2] + dht11_val[3]) 0xFF)) {printf ("rh:%d,temp:%d\n", dht11_val[0], dht11_
# encoding=utf-8 # Power By:funco_ small Wind import rpi.gpio as GPIO import Time # delay function def delay (i): while i:i = 1 # Early init dht11 Connection pin # DHT11_PIN-DHT11 connection PIN number def init_dht11 (dht11_pin): # Output mode initial state to High level Gpio.setup (Dht11_pin, GPIO. Out) Gpio.output (Dht11_pin, 1) # used to get the pin number of the # DHT11_PIN-
Tests have been performed on the STM32. This example uses the PC0 pin to connect the DHT11 data pin.
In the main function, call the Dth11_test function in the code below.
Data definition: //----The following variables are global variables-------- //----High temperature 8-bit = = u8t_data_h------ //----Temperature Low 8-bit = = u8t_data_l------ //----Humidity 8-bit = = u8rh_data_h----- //---- Low
has been tested on the STM32. This example uses the PC0 pin to connect the DHT11 data pins.
The Dth11_test function in the following code is invoked in the main function.
Data definition: //----The following variables are global variables-------- //----temperature is high 8 bit = = u8t_data_h------ //----temperature low 8 bit = = u8t_data_l------ //----Humidity High 8-bit = = u8rh_data_h----- //----
is what.
A: The DHT11 is a digital temperature and humidity sensor, which includes 1 resistive sensing elements and a NTC thermometer, and is connected to 1 high-performance 8-bit monolithic microcomputer.
1) Humidity
Measuring range: 20-90%
Precision: ±5%RH
2) temperature
Measuring range: RH 0-50 ℃
Precision: ±2℃
after the module test, make sure the ESP8266 is working properly and start connecting with Arduino to upload the data detected by the DHT11 temperature and humidity sensor to the monitoring platform. Prior to understand the platform has Yeelink and thingspeak, the principle should be the same, I choose Thingspeak here, we can try Yeelink, welcome to provide learn
I. DHT11 INTRODUCTIONDHT11 digital temperature and humidity sensor, is a calibrated digital signal output of the humidity and temperature of the complex sensor. It uses a dedicated digital module acquisition technology and temperature and
Recently used in the temperature and humidity sensor, AM2305 drive, single bus, on the power of at least 2S to read temperature and humidity, temperature accuracy is high, like DS18B20, data with the checksum, will not appear ds18b20, and the timing is not high
/****************************************************************************************************
Source: http://www.ieechina.com/Upload/Tech/748.htmAbstract: The integrated humidity sensor ih3605 can adjust the signal in the chip, and has high precision and good linearity. This article introduces its performance and structure features, and provides typical application instances of ih3605.Keywords:Humidity Sensor; integrated circuit; ih3605Document Identific
AM2321 is a digital temperature and humidity sensor in Guangzhou ausone electronics production. Although it is a domestic brand, its precision can be comparable with foreign mainstream temperature and humidity sensing IC.
Size: 11.3x7.8x4mm (L x W x H)
Package: 0.05 pitch PTH
Operating voltage: 2.6~5v
Interface: i²c, maximum rate 100kbps, wit
SI7021 is a temperature and humidity sensor chip produced by Silicon Labs. Its main features:
Humidity accuracy: Error typ. +/-2%RH, Max +/-3%rh (0~80%RH), factory corrected
Temperature accuracy: Error typ. +/-0.3%°c, Max +/-0.4%°c ( -10°c~85°c), factory corrected
Measuring range: Temperature range 0~100%rh, maximum temperature range -40°c~125°c
Recently used temperature and humidity sensor, AM2305 drive, single bus, after power on at least a delay of 2S to read temperature and humidity, temperature accuracy is high, with the same as DS18B20, data with calibration, will not appear ds18b20, and timing requirements are not high
/****************************************************************************
Boot Root Automatic LoginIf you want to enter in the HyperTerminal, login and execute, you can add commands in the/etc/profile;If you implement an automatic login for power on, and modify it in/etc/inittab, each development board may be modified in a different way.Http://blog.chinaunix.net/uid-27717694-id-3543938.htmlAuto-run application on bootBypass login, only need to directly modify/etc/init.d/rcs a file, add a program or script command can be run automatically:Similar to Autobat automatic b
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.